package com.itheima.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.service.StatisticsOfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.apache.dubbo.config.annotation.Reference;

import java.util.List;
import java.util.Map;

@RestController
@Api(tags = "统计模块管理")
public class StatisticsOfController {

    @Reference
    private StatisticsOfService statisticsOfService;



    @GetMapping("StatisticsOf/selectPackage")
    @ApiOperation(value = "统计模块管理", notes = "套餐占比")
    public Result selectPackage() {
        //先获取要删除的信息对象id  执行物理删除中间表以及setmeal表对应数据
        try {
            List<Map> list = statisticsOfService.selectPackage();
            System.out.println(list);
            return new Result(true, "查询套餐占比成功", list);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false, "查询套餐占比失败");
        }
    }


}
